<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>&nbsp;</title>
    </head>
    <body>

        <#if user??>
            <form id="fm" method="post" action="sys/user/upass">
            <input name="id" type="hidden" value="${(user.id)!}">
            
            <div style="margin-bottom:10px">
                    <input class="easyui-passwordbox" name="oldpass" style="width:100%"  data-options="label:'旧密码:',required:true">
            </div>
            
            <div style="margin-bottom:10px">
                    <input class="easyui-textbox" name="newpass" style="width:100%"  data-options="label:'新密码:',required:true">
            </div>
        <#else>
             无效账号
        </#if>
        
        </form>
        <div style="text-align:center;padding:5px">
            <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">保存</a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <#if user??>
                          <td align="center"><a href="javascript:void(0)" class="easyui-linkbutton" onclick="closeForm()" style="width:80px">关闭</a></td>
                       <#else>
                           <td align="center"><a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:80px">重置</a></td>
                       </#if>
        </div>
       
       <script type="text/javascript">
            function submitForm(){
                $('#fm').form('submit',{
                	success:function(r){
                		var rs=JSON.parse(r);
                		if(rs.code>0){
                			layer.alert(rs.desc);
                		}else{
                			$('#form').dialog('close');	
                			window.parent.tips('密码修改成功!');
                		}
                	}
                });
            }
            function clearForm(){
                $('#fm').form('clear');
            }
            function closeForm(){
            	$('#form').dialog('close');
            }
       </script>
    </body>
     
</html>